package com.liu.test0303.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author xianguang
 * @date 2020-03-03 14:59
 */
@Controller
@RequestMapping("/")
public class StringTest {

    @ResponseBody
    @RequestMapping("/test")
    public String test(@RequestParam() String str){
        char[] chars = str.toCharArray();
        String reverse = "";
        for (int i = chars.length - 1; i >= 0; i--) {
            reverse += chars[i];
        }
        return reverse;
    }

    public static void main(String[] args) {
           int i=0;
           i++;
        System.out.println(i);
    }
    public void add(int i){
        i++;
    }
}
